package hypeerweb;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

public abstract class NodeState {
	public static final int STANDARD_NODE_STATE = 0;
	public static final int DOWN_POINTING_NODE_STATE = 1;
	public static final int CAP_NODE_STATE = 2;

	public abstract Node findCapNodeFrom(Node refNode);

	public abstract int getStateId();

	public abstract String toString();

	public static NodeState getNodeState(int stateId) {
		switch (stateId) {
			case 0 :
				return StandardNodeState.getSingleton();
			case 1 :
				return DownPointingNodeState.getSingleton();
			case 2 :
				return CapNodeState.getSingleton();
			default :
				throw new NotImplementedException();
		}
	}
}